/**
 * 获取本地登录消息与判断本地数据是否为空
 * @param {String} name 
 * @returns 
 */
export function getUser(name) {
  const userString = localStorage.getItem(name)
  const parsedUser = JSON.parse(userString)

  // 判断本地存储中是否存在值
  const existsInLocalStorage = userString !== null

  return {
    user: parsedUser,
    existsInLocalStorage: existsInLocalStorage
  }
}